#include <iostream>
#include <string>

using namespace std;

class Person {
  public:
    Person(string n, int a, bool s);
    virtual void Show();
    virtual ~Person();

  protected:
    string name;
    int age;
    bool sex;
};

class Teacher : virtual public Person {
  public:
    Teacher(string n, int a, bool s, string t);
    void Show() override;

  protected:
    string title;
};

class Cadre : virtual public Person {
  public:
    Cadre(string n, int a, bool s, string p);
    void Show() override;

  protected:
    string post;
};

class TeacherCadre : public Teacher, public Cadre {
  public:
    TeacherCadre(string n, int a, bool s, string t, string p, double w);
    void Show() override;

  protected:
    double wages;
};

Person::Person(string n, int a, bool s) : name(n), age(a), sex(s) {}
void Person::Show() { cout << name << " " << age << " " << sex << endl; }
Person::~Person() {}

Teacher::Teacher(string n, int a, bool s, string t)
    : Person(n, a, s), title(t) {}
void Teacher::Show() {}

Cadre::Cadre(string n, int a, bool s, string p) : Person(n, a, s), post(p) {}
void Cadre::Show() {
    cout << name << " " << age << " " << sex << " " << post << endl;
}

TeacherCadre::TeacherCadre(string n, int a, bool s, string t, string p,
                           double w)
    : Person(n, a, s), Teacher(n, a, s, t), Cadre(n, a, s, p), wages(w) {}
void TeacherCadre::Show() {
    cout << name << " " << age << " " << sex << " " << title << " " << post
         << " " << wages << endl;
}

int main() {
    TeacherCadre Darcy("Darcy", 21, true, "student", "monitor", 1500.0);
    Darcy.Show();
    return 0;
}
